package com.adinnet.admin.childStudyToday.service.impl;

import com.adinnet.admin.childStudyToday.model.ChildStudyToday;
import com.adinnet.admin.childStudyToday.mapper.ChildStudyTodayMapper;
import com.adinnet.admin.childStudyToday.model.form.ChildStudyTodayForm;
import com.adinnet.admin.childStudyToday.model.vo.ChildStudyTodayResp;
import com.adinnet.admin.childStudyToday.service.ChildStudyTodayService;
import com.adinnet.core.PageResult;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 今日学习时间 服务实现类
 * </p>
 *
 * @author chenjia
 * @since 2020-12-16
 */
@Service
public class ChildStudyTodayServiceImpl extends ServiceImpl<ChildStudyTodayMapper, ChildStudyToday> implements ChildStudyTodayService {

    @Override
    public PageResult<ChildStudyTodayResp> queryList(ChildStudyTodayForm cstForm) {
        Page<ChildStudyTodayResp> page = new Page<>(cstForm.getPage(), cstForm.getLimit());
        List<ChildStudyTodayResp> list = baseMapper.queryList(page, cstForm);
        return new PageResult<>(list, cstForm.getTotal());
    }
}
